package com.prim.threadcoreknowledge.createthread;

/**
 * 使用继承Thread方式实现线程
 *
 * @author prim
 */
public class ThreadStyle extends Thread {
    public static void main(String[] args) {
//        ThreadStyle threadStyle = new ThreadStyle();
        //同时传入runnable
        ThreadStyle threadStyle = new ThreadStyle(new RunnableStyle());
        threadStyle.start();
    }

    public ThreadStyle() {
    }

    public ThreadStyle(Runnable target) {
        super(target);
    }

    @Override
    public void run() {
        System.out.println("使用Thread方式创建线程");
    }
}
